﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Fur.Database.Migrations.Migrations
{
    public partial class add_tenant_table : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Tenant",
                columns: table => new
                {
                    TenantId = table.Column<Guid>(type: "TEXT", nullable: false),
                    Name = table.Column<string>(type: "TEXT", nullable: false),
                    Host = table.Column<string>(type: "TEXT", nullable: false),
                    Schema = table.Column<string>(type: "TEXT", nullable: true),
                    ConnectionString = table.Column<string>(type: "TEXT", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "TEXT", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Tenant", x => x.TenantId);
                });

            migrationBuilder.InsertData(
                table: "Tenant",
                columns: new[] { "TenantId", "ConnectionString", "CreatedTime", "Host", "Name", "Schema" },
                values: new object[] { new Guid("383afb88-f519-fff8-b364-6d563bf3687f"), null, new DateTime(2020, 10, 6, 20, 19, 7, 0, DateTimeKind.Unspecified), "localhost:44313", "默认租户", null });

            migrationBuilder.InsertData(
                table: "Tenant",
                columns: new[] { "TenantId", "ConnectionString", "CreatedTime", "Host", "Name", "Schema" },
                values: new object[] { new Guid("c5798cb6-16d6-0f42-eb56-59c695353bc0"), null, new DateTime(2020, 10, 6, 20, 20, 32, 0, DateTimeKind.Unspecified), "localhost:5000", "其他租户", null });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Tenant");
        }
    }
}
